package com.py.credit.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.py.credit.entity.Organization;
import com.py.framework.core.common.Page;

public interface OrgDao {

	void add(Organization org);

	void update(Organization org);

	List<Map<String, Object>> selectOrgListByConditionForPage(@Param(value = "orgId") String orgId,
			@Param(value = "columns") List<String> showColumns,
			@Param(value = "additionalColumns") String[] additionalColumns, @Param(value = "page") Page page,
			@Param(value = "conditions") List<String> conditions);

	Organization select(@Param(value = "orgId") String orgId);

	List<Map<String, Object>> selectAccountListByConditionForPage(@Param(value = "orgId") String orgId,
			@Param(value = "columns") List<String> showColumns,
			@Param(value = "additionalColumns") String[] additionalColumns, @Param(value = "page") Page page,
			@Param(value = "conditions") List<String> conditions);

	Organization selectById(@Param(value = "id") String id);

	List<Organization> selectAllOrgList(@Param(value = "name") String name, @Param(value = "page") Page page,
			@Param(value = "modelId") String modelId);

	List<Organization> selectOrgList(@Param(value = "name") String name);

	void addModelOrg(@Param(value = "modelId") String modelId, @Param(value = "list") String[] orgIds);

	List<Map<String, Object>> selectOrgListByModelIdForPage(@Param(value = "id") String id,
			@Param(value = "name") String name, @Param(value = "page") Page page);

	List<Map<String, Object>> selectModelListByOrgIdForPage(@Param(value = "id") String id,
			@Param(value = "name") String name, @Param(value = "page") Page page);

	void deleteByModelId(@Param(value = "list") String[] modelIds);

	void deleteByOrglId(@Param(value = "list") String[] orgIds);

	void deleteByOrgIdAndModelIds(@Param(value = "orgId") String orgId, @Param(value = "list") String[] modelIds);

	void deleteByModelIdAndOrgIds(@Param(value = "modelId") String modelId, @Param(value = "list") String[] orgIds);

	List<Map<String, Object>> selectActivityByConditionForPage(@Param(value = "columns") List<String> showColumns,
			@Param(value = "additionalColumns") String[] additionalColumns,
			@Param(value = "conditions") List<String> conditions, @Param(value = "page") Page page,
			@Param(value = "orgId") String orgId, @Param(value = "ids") String checkType);

	void deleteByModelAndModelId(@Param(value = "modelId") String modelId, @Param(value = "orgId") String orgId);

	int selectModelOrgInProcess(@Param(value = "modelId") String modelId, @Param(value = "list") String[] orgIds);

	int selectOrgModelInProcess(@Param(value = "orgId") String orgId, @Param(value = "list") String[] modelIds);

	int selectCountByOrgName(@Param(value = "orgName") String orgName);

}
